VMS Help  —  MACRO  Macros for Porting from VAX to Alpha or I64, Calculating Page-Size Values
    The following macros provide a standard, architecture-independent
    means for calculating page-size dependent values:

    o  $BYTES_TO_PAGES

    o  $NEXT_PAGE

    o  $PAGES_TO_BYTES

    o  $PREVIOUS_PAGE

    o  $ROUND_RETADR

    o  $START_OF_PAGE

    These macros reside in the directory SYS$LIBRARY:STARLET.MLB and
    can be used by both application code and system code. Because
    application code does not have access to SYSTEM_DATA_CELLS, you
    must supply the relevant masks, shift values, and so on.

    The shift values are correlated with the page size of the
    processor. The rightshift values are negative; the leftshift
    values are positive, as shown in Shift Values.

    Table D-1 Shift Values

    Page size                 rightshift leftshift

    512 bytes (VAX)            -9         9
    8K (OpenVMS Alpha or      -13        13
    OpenVMS I64)
    16K                       -14        14
    32K                       -15        15
    64K                       -16        16

    Typically, the application issues a call to $GETSYI (specifying
    the SYI$_PAGESIZE item descriptor) to obtain the CPU-specific
    page size and then compute other values from the page size that
    is returned.

    The following conventions apply to the macros described in this
    section:

    o  If the destination operand is blank, the source operand is
       used as the destination.

    o  All macros conditionalize code on the symbols VAXPAGE and
       BIGPAGE.

    o  Several macros allow for page-size-independent code on VAX
       systems with the independent=YES argument. These macros
       generate code in which I-stream fetches are changed to memory
       accesses. Because this is inherently slower on a VAX system,
       the default value of the independent argument is NO.
Additional Information: explode extract

$BYTES TO PAGES
$NEXT PAGE
$PAGES TO BYTES $PREVIOUS PAGE
$ROUND RETADR
$START OF PAGE
Close Help